/**************************************************************************
File:        hal.h
Description:

Copyright:   (C) 2001-2012 by ZJ Laczik
Email:       Zsolt.Laczik@eng.ox.ac.uk
****************************************************************************
Change log:
   begin      Saturday 18 February 2012
***************************************************************************/

#ifndef HAL_H
#define HAL_H

#include <comedilib.h>

#include <QObject>

class Hal : public QObject  {
    Q_OBJECT
public:
    Hal(QObject *parent=0);
    ~Hal();

    bool init();
    bool mfInitUSBDUX();
    bool mfInitZJLPP();

    bool mfIP28IsReady();
    bool mfZJLPPIsReady();
    bool mfUSBDUXIsReady();

    bool mfReadInterlockBit();
    bool mfReadSLMSyncBit();

    void mfSetWarningSignBit(bool value);
    void mfSetLaserTriggerBit(bool value);

    void mfSetXDirBit(bool value);
    void mfSetYDirBit(bool value);
    void mfSetZDirBit(bool value);

    void mfSetXStepBit(bool value);
    void mfSetYStepBit(bool value);
    void mfSetZStepBit(bool value);
public slots:
    void slotSelectDummyCtrl();
    void slotSelectIP28Ctrl();
    void slotSelectComediUSBDUXCtrl();
    void slotSelectZJLPPCtrl();
signals:
    void signalDspMsg(const QString & msg, bool f);
private:
    comedi_t *mUSBDUX;
    bool mIP28IsReady;
    bool mZJLPPIsReady;
    bool mUSBDUXIsReady;
    int mDigitalIOtype;
    int ppdev ;
};

#endif
